<template>
  <div class="box">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(banner, index) in banners" :key="index">
        <img :src="banner.img" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { getBanner1 } from "network/home";
export default {
  name: "",
  data() {
    return {
      banners: [],
    };
  },
  created() {
    getBanner1().then((res) => {
      this.banners = res;
    });
  },
};
</script>
<style scoped>
.box {
  width: 345px;
  margin: auto;
}
.my-swipe {
  border-radius: 5px;
  height: 130px;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>